/******************************************************************************
* File description: MaintenanceTabWidgetJiaReKuai.qml
* Function: 维护：加热块Tab页
* Current Version: 1.0.0
* Author: 张宇轩
* Date: 2024-08-07
*  -----
*  Copyright by 博坤生物 .
 *****************************************************************************/
import QtQuick 2.14
import QtQuick.Layouts 1.14
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4

Item {
    id: root

    /* property 定义开始 */
    // 私有

    /* property 定义结束 */

    TabView {
        id: tabView
        anchors.fill: parent

        Tab {
            title: "配置"
            component: MaintenanceJiaReKuai2PeiZhi {
                anchors {
                    fill: parent
                    topMargin: 16
                }
            }
        }

        Tab {
            title: "老化测试"
            component: MaintenanceJiaReKuai2LaoHua {
                anchors {
                    fill: parent
                    topMargin: 16
                }
            }
        }

        Tab {
            title: "升降温曲线校准"
            component: MaintenanceJiaReKuai2QuXian {
                anchors {
                    fill: parent
                    topMargin: 16
                    bottomMargin: 16
                }
            }
        }

        Tab {
            title: "温度校准"
            component: MaintenanceJiaReKuai2WenDu {
                anchors {
                    fill: parent
                    topMargin: 16
                }
            }
        }

        // 设置tabbar样式
        style: TabViewStyle {
            frameOverlap: 1                 // 此属性保留各个选项卡按钮和框架之间的重叠量
            tabsAlignment: Qt.AlignLeft  // 选项卡按钮的水平对齐方式(默认左侧)
            // 占位元素，将tab标签向右挤16px
            leftCorner: Item {
                implicitWidth: 16
                implicitHeight: 62
            }

            // 每个tab标签
            tab: Item {
                implicitWidth: tabBarLabel.implicitWidth + 2
                implicitHeight: 55 + tabBarItem.anchors.topMargin

                Rectangle {
                    id: tabBarItem
                    implicitWidth: tabBarLabel.implicitWidth
                    implicitHeight: styleData.selected ? 55 : 45
                    anchors {
                        left: parent.left
                        topMargin: 8
                        bottom: parent.bottom
                    }
                    border.width: 0
                    radius: styleData.selected ? 4 : 0
                    color: styleData.selected ? "#FFFFFFFF" : "#FFA3BACC"

                    // 文字
                    Label {
                        id: tabBarLabel
                        leftPadding: 24
                        rightPadding: 24
                        anchors{
                            centerIn: parent
                        }
                        font.family: 'Alibaba PuHuiTi'
                        font.pixelSize: styleData.selected ? 18 : 16
                        color: styleData.selected ? "#FF222222" : "#FFFFFF"
                        text: qsTr(styleData.title)
                    }
                }
            }

            // 边框
            frame: Rectangle {border.width: 0}
        }
    }
}
